package com.joysuch.wwyt.workflow.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * 描述：用户操作类型枚举<br>
 *
 * @author jingwk<br>
 * @version 1.0 <br>
 * 日期:2021年03月30日 上午10:57:00
 */
public enum WorkFlowOperationEnum {

    APPROVE("A", "审核"),
    EXECUTE("E", "执行"),
    SUBMIT("S", "提交"),
    APPLY("AP", "申请"),
    BECOME_INVALID("BI", "作废"),
    APPROVE_AGREE("AG", "同意"),
    APPROVE_DISAGREE("AD", "不同意");

    private String value;

    private String desc;

    WorkFlowOperationEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public final String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    private static final Map<String, WorkFlowOperationEnum> lookup = new HashMap<>();

    static {
        for (WorkFlowOperationEnum e : EnumSet.allOf(WorkFlowOperationEnum.class)) {
            lookup.put(e.value, e);
        }
    }

    public static WorkFlowOperationEnum find(String value) {
        return lookup.get(value);
    }
}
